﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Dotgiamsat.aspx.cs" Inherits="Giamsatdinhky_Dotgiamsat" Title="Untitled Page" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
           
         <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

            <script type="text/javascript">
            function RowDblClick(sender, eventArgs)
            {
              sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
            </script>

        </telerik:RadCodeBlock>
        <br />
        <fieldset id="divNhapLieu" style="width:600px;">
<legend style="margin-left:20px;"><span style="color: #666633; font-family: Verdana"><strong>
    Tìm kiếm</strong></span></legend>
<table cellpadding="2" cellspacing="1"  id="tblTimKiem">
<tr style="height: 19px;">
		<td style="width: 151px"><br /><span style="font-size: 9pt; color: #000000;margin-left:20px;">
		    Đợt giám sat</span>
    </td>
        <td style="width: 369px"><br /><span style="margin-left:40px;">
            <telerik:RadTextBox ID="txtTen" runat="server">
            </telerik:RadTextBox></span>
        </td>
</tr>
<tr style="height: 19px;">
		<td style="width: 146px"><span style="font-size: 9pt; color: #000000;margin-left:20px">
		    Ngày giám sát &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; từ&nbsp;&nbsp;&nbsp;:</span>
    </td>
        <td style="width: 369px"><span style="margin-left:40px;">
			    <telerik:RadDatePicker ID="dtFNgayGiamSat" MinDate="1/1/1900" Culture="Vietnamese (Vietnam)"
			                 Style="vertical-align: middle;" runat="server"
			                 Skin="Web20">
			       </telerik:RadDatePicker></span>
	    </td>
	<tr>
	<td style="width: 146px"><span style="font-size: 9pt; color: #000000;margin-left:90px">
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Đến&nbsp;:</span>
    </td>
	    <td>
		    <span style="margin-left:40px;">
		    <telerik:RadDatePicker ID="dtTNgayGiamSat" MinDate="1/1/1900" Culture="Vietnamese (Vietnam)"
			                 Style="vertical-align: middle;" runat="server"
			                 Skin="Web20">
			       </telerik:RadDatePicker></span>
    </td></tr>
</tr>
		<tr>
            <td  colspan="2" align="center">
                <table width="100%"><tr><td style="height: 25px">
                <telerik:RadButton ID="RadButton1" runat="server" Text="Tìm kiếm" Skin="Hay" OnClick="Button1_Click">
                    </telerik:RadButton></td>
                </tr></table>
      </td></tr>
    </table>
</fieldset>

        
        
            <p id="divMsgs" runat="server">
        <asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080"></asp:Label>
        <asp:Label ID="Label2" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000"></asp:Label>
            </p>
      
         <!-- load ajax-->
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid_dgsat">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid_dgsat" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="divMsgs" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        </telerik:RadAjaxManager>
        <!-- end-->
        
        
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
            BackColor="#99FF66" Skin="WebBlue" />
        <telerik:RadGrid ID="RadGrid_dgsat" runat="server" AllowPaging="True" 
            AllowSorting="True" CellSpacing="0" DataSourceID="SqlDataSource_dgsat" 
            GridLines="None" AllowAutomaticDeletes="True" AutoGenerateColumns="False"
            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" OnItemUpdated="RadGrid_dgsat_ItemUpdated"
             
           OnItemInserted="RadGrid_dgsat_ItemInserted" OnDataBound="RadGrid_dgsat_DataBound" Skin="Telerik">
                <HeaderContextMenu></HeaderContextMenu>

                <MasterTableView AutoGenerateColumns="False" DataKeyNames="Madotgs" 
                                DataSourceID="SqlDataSource_dgsat" CommandItemDisplay="Top">
                                
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>

                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>

    <Columns>
    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <ItemStyle />
                    </telerik:GridEditCommandColumn>
                    
        <telerik:GridBoundColumn DataField="Madotgs" DataType="System.Int32"  Visible="false"
            FilterControlAltText="Filter Madotgs column" HeaderText="Madotgs" ReadOnly="True" 
            SortExpression="Madotgs" UniqueName="Madotgs">
        </telerik:GridBoundColumn>
        
           <telerik:GridTemplateColumn HeaderText="STT">
                       <ItemTemplate>
                        <asp:Label runat="server" ID="lblSTT" Text='<%#i++%>'></asp:Label>
                       </ItemTemplate>
           </telerik:GridTemplateColumn>
        
       
       <telerik:GridDateTimeColumn DataField="Ngaygiamsat" DataType="System.DateTime" PickerType="DatePicker"
                                    FilterControlAltText="Filter Ngaygiamsat column" HeaderText="Ngày giám sát" 
                                    SortExpression="Ngaygiamsat" UniqueName="Ngaygiamsat" MaxDate="12/31/2099 " MinDate="1/1/1900 ">
                                </telerik:GridDateTimeColumn>
                                
        

        
        <telerik:GridBoundColumn DataField="Dotgiamsat" 
            FilterControlAltText="Filter Dotgiamsat column" HeaderText="Dotgiamsat" 
            SortExpression="Dotgiamsat" UniqueName="Dotgiamsat">
        </telerik:GridBoundColumn>
       
        <telerik:GridHTMLEditorColumn DataField="Ghichu" 
            FilterControlAltText="Filter Ghichu column" HeaderText="Ghichu" 
            SortExpression="Ghichu" UniqueName="Ghichu">
        </telerik:GridHTMLEditorColumn>
       
        <telerik:GridButtonColumn ConfirmText="Delete this Dotgiamsat?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                        UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>
    </Columns>

           
            
            
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
</EditFormSettings>

           
            
            
           </MasterTableView>
           <ClientSettings EnableRowHoverStyle="true">
               <Selecting AllowRowSelect="True" />
               <ClientEvents OnRowDblClick="RowDblClick" />
           </ClientSettings>


<FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource_dgsat" runat="server"
          ConnectionString="<%$ ConnectionStrings:QLMTConnectionString %>" ProviderName="System.Data.SqlClient"
          SelectCommand="SELECT * FROM Dotgiamsat"
           DeleteCommand="DELETE FROM [Dotgiamsat] WHERE [Madotgs] = @original_Madotgs"
           InsertCommand="INSERT INTO Dotgiamsat(Dotgiamsat,Ngaygiamsat,Ghichu) VALUES (@Dotgiamsat,@Ngaygiamsat,@Ghichu)"
           UpdateCommand="UPDATE [Dotgiamsat] SET [Dotgiamsat] = @Dotgiamsat, [Ngaygiamsat]=@Ngaygiamsat,[Ghichu]=@Ghichu WHERE [Madotgs] = @original_Madotgs"
           
          OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues">
         
          
          <DeleteParameters>
               <asp:Parameter Name="original_Madotgs" Type="Int32" />
           </DeleteParameters>
           <UpdateParameters>
               
               <asp:Parameter Name="Dotgiamsat" Type="String" />
               <asp:Parameter Name="Ngaygiamsat" Type="DateTime" />               
               <asp:Parameter Name="Ghichu" Type="String" />
               
               <asp:Parameter Name="original_Madotgs" Type="Int32" />
               
               
           </UpdateParameters>
           <InsertParameters>                
               
              <asp:Parameter Name="Dotgiamsat" Type="String" />
               <asp:Parameter Name="Ngaygiamsat" Type="DateTime" />               
               <asp:Parameter Name="Ghichu" Type="String" />
              
              
           </InsertParameters>
          
      </asp:SqlDataSource>
   
       <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="200px" />
       <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor2" runat="server" TextBoxStyle-Width="150px" />
       <telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server" DropDownStyle-Width="110px" />
       <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server" NumericTextBox-Width="40px" />

</asp:Content>

